<script src="/assets/js/jquery.bootbox.min.js"></script>
<script src="/b/<%=branch%>/proxy/config?key=item,unit,chip,egg,box,itemGroup,unitBase,gem,MsgList,"></script>
<script src="/assets/item.js"></script>
<script>
    function afterShowForm(e,edit){
        if(!edit){
            $("#multi").val(1)
            $("#repeat").val(1)
        }
    }


    var NewsColModel = [
        {label: '每码使用次数', name: 'multi',width: 120, editable: true, sortable:false,hidden:false,resize:true,fixed:true,search:false,},
        {label: '每人使用个数', name: 'repeat',width: 200, editable: true, sortable:false,hidden:false,resize:true,fixed:true,search:false,},

        {label: '获得道具', name: 'item',width: 180, editable: true, sortable:false,hidden:false,resize:true,fixed:false,search:false,
            formatter:cosjs.item.formatter,
            unformat:cosjs.item.unformat,
            editoptions: { width:300,dataInit: function (element) { new cosjs.item.select(element); } }
        }
    ];


    var NewNavbar = [
        {
            title:"下载兑换码",
            caption:"",
            position : "last",
            onClickButton: function(){
                var id=$(grid_selector).jqGrid("getGridParam","selrow");
                if(!id){
                    return layer.alert('请先选择兑换码');
                }
                var data = $(grid_selector).jqGrid("getRowData",id);
                var name = "下载兑换码 --> "+data['name'];
                var index = cosjs.layer.show(name,GURL('branch/expage','index?cid='+id));
                layer.full(index);
            }
        }
    ]
</script>

